package com.aos.erp.manager.mapper.notice;

import com.aos.erp.common.dao.mapper.SuperMapper;
import com.aos.erp.manager.dto.NoticeDetailDTO;
import com.aos.erp.manager.model.notice.vo.NoticeConditionVo;
import com.aos.erp.manager.model.notice.vo.NoticeVo;
import com.aos.erp.manager.model.notice.NoticeInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface NoticeMapper extends SuperMapper<NoticeInfo> {

    /**
     * 分页查询公告列表
     * @param pageBean
     * @param param
     * @return
     */
    List<NoticeDetailDTO> pageNoticeList(IPage<NoticeDetailDTO> pageBean, @Param("param") NoticeConditionVo param);

     @Update("update t_notice set update_time=now(),n_title='${noticeTitle}',n_content='${noticeContent}',tips_start_time='${tipsStartTimeFormat}',tips_end_time='${tipsEndTimeFormat}',update_user='${optUser}' where id=#{id}")
    void updateNotice(NoticeVo dataInfo);

    @Update("update t_notice set is_del=-1 where id in (${dataId})")
    void deleteNotice(@Param("dataId") String noticeId);
}
